package com.hnevc.androiduiclassone5;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    Button btnCharge ;
    EditText etCarNumber;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnCharge = findViewById(R.id.btn_charge);
        btnCharge.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                etCarNumber = findViewById(R.id.et_carnumber);
                String carnumber = etCarNumber.getText().toString();
                MyDialog dialog = new MyDialog(MainActivity.this, carnumber, new MyDialog.OnCharge() {
                    @Override
                    public void updateAmount(String amount) {
                        TextView mTvAmount = findViewById(R.id.tv_massage);
                        mTvAmount;setText(amount);
                    }
                });
                dialog.show();
            }
        });
    }
}
